const mongoose = require('mongoose')

const typeSchema = new mongoose.Schema({
  code: {
    type: String,
    required: true,
    unique: true
  },
  name: {
    type: String,
    required: true
  },
  deleted: {
    type: Boolean,
    required: true,
    default: () => false
  },
  note: String,
  disabled: {
    type: Boolean,
    default: () => false
  }
})

const typeModel = mongoose.model('Type', typeSchema)

module.exports = typeModel